﻿Public Class HotelList
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.Params("Tag") = Nothing Or Request.Params("Tag") = "" Then
            SqlDataSource3.SelectCommand = "SELECT * FROM Hotels"
        Else
            SqlDataSource3.SelectCommand = "SELECT DISTINCT [HotelName], [Stars], [Description], [Pictures], [HotelUrl] FROM [HotelTagView] WHERE ([Tag] = ?)"
        End If

        If User.IsInRole("superuser") Then
            ph_SuperUsers.Visible = True
        Else
            ph_SuperUsers.Visible = False
        End If
    End Sub

    Protected Function getStars(ByVal stars As Integer)
        Dim retVal As String = ""
        For index As Integer = 0 To stars
            retVal += "*"
        Next
        Return retVal
    End Function


End Class